<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="./js/vue.js"></script>
<body>
    <div class="box">
        <!-- 按键修饰符指定某个键触发时才会触发该事件
        按键修饰符可以填写键的别名 还可以填写它keyCode

        -->
        <input type="text" v-model="msg" @keyup.13="getMsg">
    </div>
    <script>
        const vm = new Vue({
            el:'.box',
            data:{
                msg:''
            },
            methods: {
                getMsg(){
                    console.log(this.msg);
                }
            },
        })
    </script>
</body>
</html>